package main

func checkSubarraySum(nums []int, k int) bool {
	for i := 0; i < len(nums); i++ {
		last := nums[i]
		for j := i; j < len(nums); j++ {
			if j-i == 0 {
				last = nums[j]
				continue
			}

			last += nums[j]

			if last%k == 0 {
				return true
			}
		}
	}

	return false
}
